package com.macro.mall.model;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * cn_region_info实体类
 *
 * @author gaodx
 *
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CnRegionInfo implements Serializable{
	/**自增ID*/
    @ApiModelProperty(value = "自增ID")
	private Integer criId; 
	/**代码*/
    @ApiModelProperty(value = "代码")
	private String criCode; 
	/**名称*/
    @ApiModelProperty(value = "名称")
	private String criName; 
	/**简称*/
    @ApiModelProperty(value = "简称")
	private String criShortName; 
	/**上级代码*/
    @ApiModelProperty(value = "上级代码")
	private String criSuperiorCode; 
	/**经度*/
    @ApiModelProperty(value = "经度")
	private String criLng; 
	/**纬度*/
    @ApiModelProperty(value = "纬度")
	private String criLat; 
	/**排序*/
    @ApiModelProperty(value = "排序")
	private Integer criSort; 
	/**创建时间*/
    @ApiModelProperty(value = "创建时间")
	private Date criGmtCreate; 
	/**修改时间*/
    @ApiModelProperty(value = "修改时间")
	private Date criGmtModified; 
	/**备注*/
    @ApiModelProperty(value = "备注")
	private String criMemo; 
	/**状态*/
    @ApiModelProperty(value = "状态")
	private Integer criDataState; 
	/**租户ID*/
    @ApiModelProperty(value = "租户ID")
	private String criTenantCode; 
	/**级别*/
    @ApiModelProperty(value = "级别")
	private String criLevel; 
	/**级别*/
    @ApiModelProperty(value = "级别")
	private List<CnRegionInfoList> list;
	/**
	 * 实例化
	 */
	public CnRegionInfo() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */

	public CnRegionInfo(JSONObject obj) {
		this();
		if (obj.get("criId") instanceof Number) {
			this.setCriId(((Number) obj.get("criId")).intValue());
		}
		if (obj.get("criCode") instanceof String) {
			this.setCriCode((String) obj.get("criCode"));
		}
		if (obj.get("criName") instanceof String) {
			this.setCriName((String) obj.get("criName"));
		}
		if (obj.get("criShortName") instanceof String) {
			this.setCriShortName((String) obj.get("criShortName"));
		}
		if (obj.get("criSuperiorCode") instanceof String) {
			this.setCriSuperiorCode((String) obj.get("criSuperiorCode"));
		}
		if (obj.get("criLng") instanceof String) {
			this.setCriLng((String) obj.get("criLng"));
		}
		if (obj.get("criLat") instanceof String) {
			this.setCriLat((String) obj.get("criLat"));
		}
		if (obj.get("criSort") instanceof Number) {
			this.setCriSort(((Number) obj.get("criSort")).intValue());
		}
		this.setCriGmtCreate((Date) obj.get("criGmtCreate"));
		this.setCriGmtModified((Date) obj.get("criGmtModified"));
		if (obj.get("criMemo") instanceof String) {
			this.setCriMemo((String) obj.get("criMemo"));
		}
		if (obj.get("criDataState") instanceof Number) {
			this.setCriDataState(((Number) obj.get("criDataState")).intValue());
		}
		if (obj.get("criTenantCode") instanceof String) {
			this.setCriTenantCode((String) obj.get("criTenantCode"));
		}
		if (obj.get("criLevel") instanceof String) {
			this.setCriLevel((String) obj.get("criLevel"));
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getCriId() != null) {
			result.put("criId",this.getCriId());
		}
		if (this.getCriCode() != null) {
			result.put("criCode",this.getCriCode());
		}
		if (this.getCriName() != null) {
			result.put("criName",this.getCriName());
		}
		if (this.getCriShortName() != null) {
			result.put("criShortName",this.getCriShortName());
		}
		if (this.getCriSuperiorCode() != null) {
			result.put("criSuperiorCode",this.getCriSuperiorCode());
		}
		if (this.getCriLng() != null) {
			result.put("criLng",this.getCriLng());
		}
		if (this.getCriLat() != null) {
			result.put("criLat",this.getCriLat());
		}
		if (this.getCriSort() != null) {
			result.put("criSort",this.getCriSort());
		}
		if (this.getCriGmtCreate() != null) {
			result.put("criGmtCreate",this.getCriGmtCreate());
		}
		if (this.getCriGmtModified() != null) {
			result.put("criGmtModified",this.getCriGmtModified());
		}
		if (this.getCriMemo() != null) {
			result.put("criMemo",this.getCriMemo());
		}
		if (this.getCriDataState() != null) {
			result.put("criDataState",this.getCriDataState());
		}
		if (this.getCriTenantCode() != null) {
			result.put("criTenantCode",this.getCriTenantCode());
		}
		if (this.getCriLevel() != null) {
			result.put("criLevel",this.getCriLevel());
		}
		return result;
	}


	@Override
	public String toString() {
		return "CnRegionInfo [criId=" + criId + " , criCode=" + criCode + " , criName=" + criName + " , criShortName=" + criShortName + " , criSuperiorCode=" + criSuperiorCode + " , criLng=" + criLng + " , criLat=" + criLat + " , criSort=" + criSort + " , criGmtCreate=" + criGmtCreate + " , criGmtModified=" + criGmtModified + " , criMemo=" + criMemo + " , criDataState=" + criDataState + " , criTenantCode=" + criTenantCode + " , criLevel=" + criLevel + "  ]";
	
	}
	
	
}
